﻿/*
 * ScanFiles.h
 *
 */

#ifndef __GDK_SCANFILES_H__
#define __GDK_SCANFILES_H__

#include <gdk/core/Types.h>
#include <gdk/core/String.h>
#include <gdk/core/Callback.h>
#include <vector>


namespace gdk
{


	///////////////////////////////////////////////////////////////
	GDK_CORE_EXPORT void scanFiles(CallbackHandler<bool, String const&> const &callback, String const &path, Char const *ext[], bool subDir = true);
	GDK_CORE_EXPORT void scanFiles(std::list<String> &files, String const &path, Char const *ext[], bool subDir = true);

	__INLINE__ void scanFiles(bool(*func)(String const&), String const &path, Char const *ext[], bool subDir = true)
	{
		return scanFiles(CallbackHandler<bool, String const&>(func), path, ext, subDir);
	}
	template<typename TyClass>
	__INLINE__ void scanFiles(SharedPtr<TyClass> const &obj, bool(TyClass::*func)(String const&), String const &path, Char const *ext[], bool subDir = true)
	{
		return scanFiles(CallbackHandler<bool, String const&>(obj, func), path, ext, subDir);
	}
	template<typename TyClass>
	__INLINE__ void scanFiles(TyClass *obj, bool(TyClass::*func)(String const&), String const &path, Char const *ext[], bool subDir = true)
	{
		return scanFiles(CallbackHandler<bool, String const&>(obj, func), path, ext, subDir);
	}
	template<typename TyClass>
	__INLINE__ void scanFiles(TyClass &obj, bool(TyClass::*func)(String const&), String const &path, Char const *ext[], bool subDir = true)
	{
		return scanFiles(CallbackHandler<bool, String const&>(obj, func), path, ext, subDir);
	}
	template<typename TyClass>
	__INLINE__ void scanFiles(gdk::Unknown::Handle_T<TyClass> const &obj, bool(TyClass::*func)(String const&), String const &path, Char const *ext[], bool subDir = true)
	{
		return scanFiles(CallbackHandler<bool, String const&>(obj, func), path, ext, subDir);
	}



}//namespace gdk


#endif /*__GDK_SCANFILES_H__*/
